package com.xhb.dubbo.service.impl;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import com.xhb.dubbo.api.UserService;
import com.xhb.dubbo.entity.User;


@Service
@Component
public class UserServiceImpl implements UserService {
    @Autowired
    private Environment environment;

    @Override
    public String showUserName(User user) {
        String port = environment.getProperty("server.port");
        String applicationName = environment.getProperty("spring.application.name");
        String dubboName = environment.getProperty("dubbo.application.name");
        System.out.println("端口：" + port);
        System.out.println("服务：" + applicationName);
        System.out.println("dubboName：" + dubboName);
        return user.getName() + "---服务端返回";
    }

}
